#include "Line.h"

Line::~Line(void)
{
}

bool Line::Intersects(Line line1)
{
	if(line1.slope == this->slope)
		return false;
	else
		return true;
}

Vertex Line::FindPointOfIntersect(Line line1)
{
	Vertex intersectionPoint;
	intersectionPoint.x = (line1.b - this->b) / (this->slope - line1.slope);
	intersectionPoint.y = (line1.slope * intersectionPoint.x) + line1.b;

	return intersectionPoint;
}

int  Line::operator==(Line  &p)
{
	return  ((x ==  p.x)  &&  (y ==  p.y) && (b == p.b) && slope == p.slope) ;
}